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

feat: support cursor configuration for interval selection #6688

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion build/vega-lite-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2863,7 +2863,7 @@
"properties": {
"cursor": {
"$ref": "#/definitions/Cursor",
"description": "The mouse cursor used over the interval mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used."
"description": "The mouse cursor used over the interval mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used.\n\n__Default value:__ `\"move\"`"
},
"fill": {
"$ref": "#/definitions/Color",
Expand Down Expand Up @@ -10285,6 +10285,10 @@
],
"type": "string"
},
"viewCursor": {
"$ref": "#/definitions/Cursor",
"description": "Set the cursor of the view outside of the brush rectangle.\n\n__Default value:__ `\"crosshair\"`\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation."
},
"zoom": {
"description": "When truthy, allows a user to interactively resize an interval selection.\nCan be `true`, `false` (to disable zooming), or a [Vega event stream\ndefinition](https://vega.github.io/vega/docs/event-streams/). Currently,\nonly `wheel` events are supported.\n\n__Default value:__ `true`, which corresponds to `wheel!`.\n\n__See also:__ [`zoom`](https://vega.github.io/vega-lite/docs/zoom.html) documentation.",
"type": [
Expand Down Expand Up @@ -10374,6 +10378,10 @@
"boolean"
]
},
"viewCursor": {
"$ref": "#/definitions/Cursor",
"description": "Set the cursor of the view outside of the brush rectangle.\n\n__Default value:__ `\"crosshair\"`\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/init.html) documentation."
},
"zoom": {
"description": "When truthy, allows a user to interactively resize an interval selection.\nCan be `true`, `false` (to disable zooming), or a [Vega event stream\ndefinition](https://vega.github.io/vega/docs/event-streams/). Currently,\nonly `wheel` events are supported.\n\n__Default value:__ `true`, which corresponds to `wheel!`.\n\n__See also:__ [`zoom`](https://vega.github.io/vega-lite/docs/zoom.html) documentation.",
"type": [
Expand Down
Binary file modified examples/compiled/bar_count_minimap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions examples/compiled/bar_count_minimap.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
{
"name": "brush",
"update": "vlSelectionResolve(\"brush_store\", \"union\")"
}
},
{"name": "cursor", "value": "default"}
],
"layout": {"padding": 20, "bounds": "full", "align": "each"},
"marks": [
Expand Down Expand Up @@ -217,6 +218,16 @@
}
]
},
{
"name": "cursor",
"push": "outer",
"on": [
{"events": "scope:mouseover", "update": "'crosshair'"},
{"events": "scope:mouseout", "update": "\"crosshair\""},
{"events": "@brush_brush:mouseover", "update": "\"move\""},
{"events": "@brush_brush:mouseout", "update": "'default'"}
]
},
{
"name": "brush_tuple_fields",
"value": [{"field": "Name", "channel": "y", "type": "E"}]
Expand Down Expand Up @@ -371,7 +382,10 @@
"type": "rect",
"clip": true,
"encode": {
"enter": {"fill": {"value": "transparent"}},
"enter": {
"cursor": {"value": "move"},
"fill": {"value": "transparent"}
},
"update": {
"x": [
{
Expand Down
Binary file modified examples/compiled/brush_table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions examples/compiled/brush_table.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
{
"name": "brush",
"update": "vlSelectionResolve(\"brush_store\", \"union\")"
}
},
{"name": "cursor", "value": "default"}
],
"layout": {"padding": 20, "bounds": "full", "align": "each"},
"marks": [
Expand Down Expand Up @@ -233,6 +234,16 @@
}
]
},
{
"name": "cursor",
"push": "outer",
"on": [
{"events": "scope:mouseover", "update": "'crosshair'"},
{"events": "scope:mouseout", "update": "\"crosshair\""},
{"events": "@brush_brush:mouseover", "update": "\"move\""},
{"events": "@brush_brush:mouseout", "update": "'default'"}
]
},
{
"name": "brush_tuple_fields",
"value": [
Expand Down Expand Up @@ -397,7 +408,10 @@
"type": "rect",
"clip": true,
"encode": {
"enter": {"fill": {"value": "transparent"}},
"enter": {
"cursor": {"value": "move"},
"fill": {"value": "transparent"}
},
"update": {
"x": [
{
Expand Down
Binary file modified examples/compiled/circle_bubble_health_income.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions examples/compiled/circle_bubble_health_income.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
]
},
{"name": "view", "update": "vlSelectionResolve(\"view_store\", \"union\")"},
{"name": "cursor", "value": "default"},
{
"name": "view_income",
"on": [
Expand Down Expand Up @@ -66,6 +67,16 @@
}
]
},
{
"name": "cursor",
"push": "outer",
"on": [
{"events": "scope:mouseover", "update": "'crosshair'"},
{"events": "scope:mouseout", "update": "\"crosshair\""},
{"events": "@view_brush:mouseover", "update": "\"move\""},
{"events": "@view_brush:mouseout", "update": "'default'"}
]
},
{
"name": "view_tuple_fields",
"value": [
Expand Down
Binary file modified examples/compiled/interactive_area_brush.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion examples/compiled/interactive_area_brush.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"name": "brush",
"update": "vlSelectionResolve(\"brush_store\", \"union\")"
},
{"name": "cursor", "value": "default"},
{
"name": "brush_x",
"value": [],
Expand Down Expand Up @@ -141,6 +142,16 @@
}
]
},
{
"name": "cursor",
"push": "outer",
"on": [
{"events": "scope:mouseover", "update": "'crosshair'"},
{"events": "scope:mouseout", "update": "\"crosshair\""},
{"events": "@brush_brush:mouseover", "update": "\"move\""},
{"events": "@brush_brush:mouseout", "update": "'default'"}
]
},
{
"name": "brush_tuple_fields",
"value": [{"field": "yearmonth_date", "channel": "x", "type": "R"}]
Expand Down Expand Up @@ -314,7 +325,10 @@
"type": "rect",
"clip": true,
"encode": {
"enter": {"fill": {"value": "transparent"}},
"enter": {
"cursor": {"value": "move"},
"fill": {"value": "transparent"}
},
"update": {
"x": [
{
Expand Down
Binary file modified examples/compiled/interactive_bin_extent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions examples/compiled/interactive_bin_extent.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
{
"name": "brush",
"update": "vlSelectionResolve(\"brush_store\", \"union\")"
}
},
{"name": "cursor", "value": "default"}
],
"layout": {"padding": 20, "columns": 1, "bounds": "full", "align": "each"},
"marks": [
Expand Down Expand Up @@ -192,6 +193,16 @@
}
]
},
{
"name": "cursor",
"push": "outer",
"on": [
{"events": "scope:mouseover", "update": "'crosshair'"},
{"events": "scope:mouseout", "update": "\"crosshair\""},
{"events": "@brush_brush:mouseover", "update": "\"move\""},
{"events": "@brush_brush:mouseout", "update": "'default'"}
]
},
{
"name": "brush_tuple_fields",
"value": [{"field": "time", "channel": "x", "type": "R"}]
Expand Down Expand Up @@ -362,7 +373,10 @@
"type": "rect",
"clip": true,
"encode": {
"enter": {"fill": {"value": "transparent"}},
"enter": {
"cursor": {"value": "move"},
"fill": {"value": "transparent"}
},
"update": {
"x": [
{
Expand Down
16 changes: 15 additions & 1 deletion examples/compiled/interactive_brush.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"name": "brush",
"update": "vlSelectionResolve(\"brush_store\", \"union\")"
},
{"name": "cursor", "value": "default"},
{
"name": "brush_x",
"init": "[scale(\"x\", 55), scale(\"x\", 160)]",
Expand Down Expand Up @@ -184,6 +185,16 @@
}
]
},
{
"name": "cursor",
"push": "outer",
"on": [
{"events": "scope:mouseover", "update": "'crosshair'"},
{"events": "scope:mouseout", "update": "\"crosshair\""},
{"events": "@brush_brush:mouseover", "update": "\"move\""},
{"events": "@brush_brush:mouseout", "update": "'default'"}
]
},
{
"name": "brush_tuple_fields",
"value": [
Expand Down Expand Up @@ -341,7 +352,10 @@
"type": "rect",
"clip": true,
"encode": {
"enter": {"fill": {"value": "transparent"}},
"enter": {
"cursor": {"value": "move"},
"fill": {"value": "transparent"}
},
"update": {
"x": [
{
Expand Down
48 changes: 44 additions & 4 deletions examples/compiled/interactive_dashboard_europe_pop.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@
{
"name": "brush",
"update": "vlSelectionResolve(\"brush_store\", \"union\")"
}
},
{"name": "cursor", "value": "default"}
],
"layout": {"padding": 20, "bounds": "full", "align": "each"},
"marks": [
Expand Down Expand Up @@ -447,6 +448,16 @@
}
]
},
{
"name": "cursor",
"push": "outer",
"on": [
{"events": "scope:mouseover", "update": "'crosshair'"},
{"events": "scope:mouseout", "update": "\"crosshair\""},
{"events": "@brush_brush:mouseover", "update": "\"move\""},
{"events": "@brush_brush:mouseout", "update": "'default'"}
]
},
{
"name": "brush_tuple_fields",
"value": [{"field": "Country", "channel": "y", "type": "E"}]
Expand Down Expand Up @@ -610,7 +621,10 @@
"type": "rect",
"clip": true,
"encode": {
"enter": {"fill": {"value": "transparent"}},
"enter": {
"cursor": {"value": "move"},
"fill": {"value": "transparent"}
},
"update": {
"x": [
{
Expand Down Expand Up @@ -768,6 +782,16 @@
}
]
},
{
"name": "cursor",
"push": "outer",
"on": [
{"events": "scope:mouseover", "update": "'crosshair'"},
{"events": "scope:mouseout", "update": "\"crosshair\""},
{"events": "@brush_brush:mouseover", "update": "\"move\""},
{"events": "@brush_brush:mouseout", "update": "'default'"}
]
},
{
"name": "brush_tuple_fields",
"value": [{"field": "Country", "channel": "y", "type": "E"}]
Expand Down Expand Up @@ -931,7 +955,10 @@
"type": "rect",
"clip": true,
"encode": {
"enter": {"fill": {"value": "transparent"}},
"enter": {
"cursor": {"value": "move"},
"fill": {"value": "transparent"}
},
"update": {
"x": [
{
Expand Down Expand Up @@ -1155,6 +1182,16 @@
}
]
},
{
"name": "cursor",
"push": "outer",
"on": [
{"events": "scope:mouseover", "update": "'crosshair'"},
{"events": "scope:mouseout", "update": "\"crosshair\""},
{"events": "@brush_brush:mouseover", "update": "\"move\""},
{"events": "@brush_brush:mouseout", "update": "'default'"}
]
},
{
"name": "brush_tuple_fields",
"value": [
Expand Down Expand Up @@ -1344,7 +1381,10 @@
"type": "rect",
"clip": true,
"encode": {
"enter": {"fill": {"value": "transparent"}},
"enter": {
"cursor": {"value": "move"},
"fill": {"value": "transparent"}
},
"update": {
"x": [
{
Expand Down
Binary file modified examples/compiled/interactive_layered_crossfilter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading